<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>简单计算器</title>
  </head>
  <body>
    <form action="/mycal" method="post">
      <!-- {{x}} 根据变量取值 -->
      <input type="text" name="x" value="{{x}}" />
      <select name="op">
        <option value="add" {% if op == "add" %} selected {% endif %}>+</option>
        <option value="sub" {% if op == "sub" %} selected {% endif %}>-</option>
        <option value="chen" {% if op == "chen" %} selected {% endif %}>*</option>
        <option value="chu" {% if op == "chu" %} selected {% endif %}>/</option>
      </select>
      <input type="text" name="y" value="{{y}}" /> = <span>{{jie}}</span>
      <div>
        <input type="submit" value="计算" />
      </div>
    </form>
  </body>
</html>
